#include "stdafx.h"
#include "decoration.h"
#include "glc/model/model.h"
#include "glc/model/modelloader.h"
#include "glc/model/modelrenderer.h"

namespace Demo {

Decoration::Decoration()
    :_model(new GLC::Model())
{
    GLC::CModelLoader loader;
    FilePathConverter conv;
    loader.Load3dsFile(conv("../images/LION2.3DS").c_str(), *_model);
}

Decoration::~Decoration()
{
}

void Decoration::render() const
{
    GLC::ModelRenderer renderer;
    glDisable(GL_TEXTURE_2D);
    glPushMatrix();
    glScaled(0.1, 0.1, 0.1);
    glRotated(180, 0, 0, 1);
    renderer.RenderModel(*_model);
    glPopMatrix();
    glEnable(GL_TEXTURE_2D);
//    glColor3f(1, 1, 0.4);
//    GLUquadric *quad = gluNewQuadric();
//    gluSphere(quad, 0.3, 20, 20);
//    gluDeleteQuadric(quad);
}

} // namespace Demo
